//PayLogModel
//2020-07-30 14:14:29

package models

import (
	"git.900sui.cn/kc/base/common/functions"
	"git.900sui.cn/kc/base/common/models/base"
	"git.900sui.cn/kc/kcgin/orm"
)

//表结构体
type PayLogModel struct {
	Model *base.Model
	Field PayLogModelField
}

//表字段
type PayLogModelField struct {
	T_table               string `default:"pay_log"`
	F_id                  string `default:"id"`
	F_order_sn            string `default:"order_sn"`
	F_pay_channel         string `default:"pay_channel"`
	F_pay_type            string `default:"pay_type"`
	F_chose_pay_type      string `default:"chose_pay_type"`
	F_real_amount         string `default:"real_amount"`
	F_insure_amount       string `default:"insure_amount"`
	F_renew_insure_amount string `default:"renew_insure_amount"`
	F_platform_amount     string `default:"platform_amount"`
	F_bus_amount          string `default:"bus_amount"`
	F_insurance_channel   string `default:"insurance_channel"`
	F_create_time         string `default:"create_time"`
}

//初始化
func (p *PayLogModel) Init(ormer ...orm.Ormer) *PayLogModel {
	functions.ReflectModel(&p.Field)
	p.Model = base.NewModel(p.Field.T_table, ormer...)
	return p
}

//新增数据
func (p *PayLogModel) Insert(data map[string]interface{}) int {
	result, _ := p.Model.Data(data).Insert()
	return result
}
